﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace WpfBeyond
{
    [JsonObject(MemberSerialization.OptIn)]
    /// <summary>
    /// 全局设置
    /// </summary>    
    public class SettingItem
    {
        private int server_port = 7102;
        private int reback_port = 7202;
        private int ffmpeg_mode = 0;
        private string ffmpeg_rtp = "rtp://224.2.2.2:5000";
        private string ffmpeg_udp = "udp://@:5000";
        private int savelog_days = 15;

        [JsonProperty]
        public int Server_port { get => server_port; set => server_port = value; }
        [JsonProperty]
        public int Reback_port { get => reback_port; set => reback_port = value; }
        [JsonProperty]
        public int Ffmpeg_mode { get => ffmpeg_mode; set => ffmpeg_mode = value; }
        [JsonProperty]
        public string Ffmpeg_rtp { get => ffmpeg_rtp; set => ffmpeg_rtp = value; }
        [JsonProperty]
        public string Ffmpeg_udp { get => ffmpeg_udp; set => ffmpeg_udp = value; }
        [JsonProperty]
        public int Savelog_days { get => savelog_days; set => savelog_days = value; }

    }

    class LocalSetting
    {
        public static string taskinfo_JsonFileName = @"TaskInfo.json";
        public static string setting_JsonFileName = @"Setting.json";
        public static string devices_JsonFileName = @"devices.json";
        public static string history_path = @"history";

        public static SettingItem Items;

        public static string History_JsonFileName { get { return history_path + "/" + DateTime.Now.ToShortDateString() + ".json"; } }
    }
}
